<h1>Editing category</h1>

<% form_for(@category) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :internal_name %><br />
    <%= f.text_field :internal_name %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </p>

  <p>
    <%= f.label :root_category %><br />
    <select name="category[root_category_id]">
	   <%= options_from_collection_for_select @root_categories, "id", "name", @category.root_category.id %>
    </select>
  </p>  
  <p>
    <%= f.label :icon %><br />
    <%= f.text_field :icon %>
  </p>
  <p>
    <%= f.label :priority %><br />
    <%= f.text_field :priority %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', @category %> |
<%= link_to 'Back', categories_path %>